package Config;

import java.util.Properties;

public class Config {

    private Properties configFile;
    private static Config instance;       

    public static boolean isLoaded() {
        if(instance == null) {                   
            //instance = new Config();
        }
        return true;      
    }

    public static void saveConfigs(Properties pros) {
        /**do nothing*/
    }

    private Config() {
        configFile = new java.util.Properties();
        try {
            configFile.load(this.getClass().getClassLoader().getResourceAsStream("config.cfg"));
        } catch (Exception eta) {
            eta.printStackTrace();
        }
    }

    private String getValue(String key) {
        return configFile.getProperty(key);
    }

    public static String getProperty(String key) {
        if (instance == null) {
            instance = new Config();
        }
        return instance.getValue(key);
    }    
}
